package com.mjk.manager.task.model;

import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.annotation.ArcSharding;
import com.mjk.common.core.jdbc.annotation.ExampleField;
import com.mjk.common.core.jdbc.annotation.Filed;
import com.mjk.common.core.jdbc.annotation.Id;
import lombok.Data;

@Data
@ArcSharding(table="task",userName="his")
public class TaskModel extends BaseEntity {
	
	@Id
	@ExampleField
	private Integer id;
	
	@ExampleField
	@Filed(comment = "任务类型 1 普通任务 2SQL任务")
	private String taskType;
	
	@ExampleField
	@Filed(comment = "任务名称")
	private String taskName;
	
	@Filed(comment = "任务调用实例")
	private String taskInstance;
	
	@Filed(comment = "任务调用方法")
	private String taskMethod;
	
	@Filed(comment = "任务内容")
	private String taskContent;
	
	@ExampleField
	@Filed(comment = "任务状态")
	private String status;
	
	@Filed(comment = "任务调度时间")
	private String corn;
	
	@Filed(comment = "任务参数")
	private String taskParams;//任务参数
	
	@Filed(comment = "运行节点名称")
	private String runName;//运行节点名称
	
	@Override
	public boolean equals(Object obj) {
        if(this == obj) {
            return true;
        }
        if(obj == null) {
            return false;
        }
        if(obj instanceof TaskModel other){
			if(this.taskName==null) {
                return false;
            }
            return this.taskName.equals(other.taskName);
        }else{
        	return false;
        }        
    }
	
	@Override
	public int hashCode() {
		return super.hashCode();
	}
}
